package discovery

import (
	"github.com/hyperway/pkg/component"
	"github.com/hyperway/pkg/helper"
	"sync"
)

var once sync.Once
var r = make([]*component.EndpointMeta, 0)

func load() []*component.EndpointMeta {
	once.Do(func() {
		err := helper.ReadFile2Obj("./conf.d/mock.yml", &r)
		if err != nil {
			panic(err)
		}
	})
	return r
}
